﻿@{
    Layout = null;
}
@using CNKI.TPI.Web.Search.Model;
@using CNKI.TPI.Web.Base
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="table table-grey">
    <thead>
        <tr class="thead">
            <th class="tdnum" style="width:30px">序号</th>
            <th class='tl' style="width:20%">数据库名称</th>
            <th class='tl' style="width:60%">检索条件</th>
            <th style="width:130px">检索时间</th>
        </tr>
    </thead>
    <tbody>
        @{if (ViewBag.SearchList != null)
          {
              int sortno = ViewBag.PageSize * (ViewBag.PageNow - 1) + 1;
              foreach (System.Data.DataRow dr in ViewBag.SearchList.Rows)
              {

                  string str = "even";
                  if (sortno % 2 == 0)
                  {
                      str = "odd";
                  }
            <tr class='@str'>
                <td>@sortno</td>
                <td>@dr["DbName"]</td>
                @if (string.IsNullOrEmpty(dr["SearchUrL"].ToString()))
                {
                    <td>@dr["Str_Query"]</td>
                }
                else
                {
                    <td><a target="_blank" href="@dr["SearchUrL"]">@dr["Str_Query"]</a></td>
                }
                <td style="text-align:center">
                    @dr["CreateTime"]
                </td>
            </tr>
                  sortno = sortno + 1;
              }
          }

        }
    </tbody>
</table>

@*//分页*@
<div class="pagenav pagenav-02">
    @*上一页*@
    @if (ViewBag.TotalPage > 0)
    {
        if (ViewBag.PageNow != 1)
        {
            int thispage = ViewBag.PageNow - 1;
        <a href="javascript:void(0);" class="page-prev" onclick="searchPageNew('@thispage')" >上一页</a>
        }
        else
        {
        <a href="javascript:return false;" onclick="return false" class="page-prev disable">上一页</a>
        }
@*循环初始化页码*@
        foreach (string numpage in ViewBag.PageList)
        {
            if (numpage != "0")
            {
                int m = int.Parse(numpage);
                if (m == ViewBag.PageNow)
                {
        <a href="javascript:void(0);" class="active" onclick="searchPageNew('@numpage')">@numpage</a>
                    
                }
                else
                {
        <a href="javascript:void(0);" onclick="searchPageNew('@numpage')">@numpage</a>
                }

            }
            else
            {
        <i class="iconfont icon-dian2"></i>
            }

        }
@*下一页*@
        if (ViewBag.TotalPage > 0 && ViewBag.PageNow != ViewBag.TotalPage)
        {
            int nextpage = ViewBag.PageNow + 1;
        <a href="javascript:void(0);" class="page-next" onclick="searchPageNew('@nextpage')" >下一页</a>
        }
        else
        {
        <a href="javascript:return false;" onclick="return false" class="page-prev disable">下一页</a>
        }
    }
    @if (@ViewBag.Count == 0)
    {
        <label>暂无数据！</label>
        
    }
    else
    {
          
        <label>共 </label>
        <label>@ViewBag.Count </label>
        <label>条数据 </label>
    }
</div>

